package View.JTable;

import java.awt.Dimension;
import java.io.File;

import javax.swing.ImageIcon;
import javax.swing.table.DefaultTableCellRenderer;

public class MyTableBooleanCellRenderer extends DefaultTableCellRenderer{
	private ImageIcon ii1 = new ImageIcon("./property/right.png");
	private ImageIcon ii2 = new ImageIcon("./property/wrong.png");

	public MyTableBooleanCellRenderer() {
		super();
		setOpaque(false);
		setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
//		setPreferredSize(new Dimension(ii1.getIconWidth(),ii1.getIconHeight()));
	}
	
	@Override
    public void setValue(Object value) {
        if ((value != null) && (value instanceof Boolean)) {
        	if ((Boolean)value == true) {
        		setIcon(ii1);
        	}
        	else if ((Boolean)value == false) {
        		setIcon(ii2);
        	}
        } 
        else {
            super.setValue(value);
        }
    } 
}
